package com.ruoyi.community.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.OwnerRoomRecordMapper;
import com.ruoyi.community.domain.OwnerRoomRecord;
import com.ruoyi.community.service.IOwnerRoomRecordService;

/**
 * 房屋绑定记录 Service业务层处理
 * 
 * @author Sea
 * @date 2025-01-02
 */
@Service
public class OwnerRoomRecordServiceImpl implements IOwnerRoomRecordService 
{
    @Autowired
    private OwnerRoomRecordMapper ownerRoomRecordMapper;

    /**
     * 查询房屋绑定记录 
     * 
     * @param recordId 房屋绑定记录 主键
     * @return 房屋绑定记录 
     */
    @Override
    public OwnerRoomRecord selectOwnerRoomRecordByRecordId(Long recordId)
    {
        return ownerRoomRecordMapper.selectOwnerRoomRecordByRecordId(recordId);
    }

    /**
     * 查询房屋绑定记录 列表
     * 
     * @param ownerRoomRecord 房屋绑定记录 
     * @return 房屋绑定记录 
     */
    @Override
    public List<OwnerRoomRecord> selectOwnerRoomRecordList(OwnerRoomRecord ownerRoomRecord)
    {
        return ownerRoomRecordMapper.selectOwnerRoomRecordList(ownerRoomRecord);
    }

    /**
     * 新增房屋绑定记录 
     * 
     * @param ownerRoomRecord 房屋绑定记录 
     * @return 结果
     */
    @Override
    public int insertOwnerRoomRecord(OwnerRoomRecord ownerRoomRecord)
    {
        ownerRoomRecord.setCreateTime(DateUtils.getNowDate());
        return ownerRoomRecordMapper.insertOwnerRoomRecord(ownerRoomRecord);
    }

    /**
     * 修改房屋绑定记录 
     * 
     * @param ownerRoomRecord 房屋绑定记录 
     * @return 结果
     */
    @Override
    public int updateOwnerRoomRecord(OwnerRoomRecord ownerRoomRecord)
    {
        ownerRoomRecord.setUpdateTime(DateUtils.getNowDate());
        return ownerRoomRecordMapper.updateOwnerRoomRecord(ownerRoomRecord);
    }

    /**
     * 批量删除房屋绑定记录 
     * 
     * @param recordIds 需要删除的房屋绑定记录 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerRoomRecordByRecordIds(Long[] recordIds)
    {
        return ownerRoomRecordMapper.deleteOwnerRoomRecordByRecordIds(recordIds);
    }

    /**
     * 删除房屋绑定记录 信息
     * 
     * @param recordId 房屋绑定记录 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerRoomRecordByRecordId(Long recordId)
    {
        return ownerRoomRecordMapper.deleteOwnerRoomRecordByRecordId(recordId);
    }
}
